<template>
    <div class="banner">
        <el-carousel :interval="5000" arrow="always"
                     style="width:  900px !important; height: 300px !important;">
            <el-carousel-item v-for="item in banner_list">
                <a href="https://www.mzitu.com/">
                    <img :src="item.img" :alt="item.name">
                </a>
            </el-carousel-item>
        </el-carousel>
    </div>
</template>

<script>
    export default {
        name: "Banner",
        data() {
            return {
                banner_list: []
            }
        },
        created() {
            this.$axios.get(this.$settings.base_url + '/home/banner/').then(response => {
                this.banner_list = response.data;
                console.log('this.banner_list:', this.banner_list);
            })
        }
    }
</script>

<style scoped>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 18px;
        opacity: 0.75;
        line-height: 300px;

        margin: 0;


    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
</style>